---
title: Custom 4-day vertical resource view
layout: demo-v4
plugins: [ daygrid, timegrid, resource-common, resource-daygrid, resource-timegrid ]
---
<script>

  document.addEventListener('DOMContentLoaded', function() {
    var calendarEl = document.getElementById('calendar');

    var calendar = new FullCalendar.Calendar(calendarEl, {
      plugins: [ 'resourceTimeGrid' ],
      timeZone: 'UTC',
      defaultView: 'resourceTimeGridFourDay',
      header: {
        left: 'prev,next',
        center: 'title',
        right: 'resourceTimeGridDay,resourceTimeGridFourDay'
      },
      views: {
        resourceTimeGridFourDay: {
          type: 'resourceTimeGrid',
          duration: { days: 4 },
          buttonText: '4 days'
        }
      },
      resources: [
        { id: 'a', title: 'Room A' },
        { id: 'b', title: 'Room B' }
      ],
      events: '{{ site.data.demo_feed_baseurl }}/demo-events.json?with-resources=2'
    });

    calendar.render();
  });

</script>
